package com.gh.reggie.common;


import org.springframework.stereotype.Component;

/**
 * 基于ThreadLocal封装工具类，用户保存Session中的id操作
 */


public class    BaseContext {

    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    //设置value
    public static void setCurrentId  (Long id){
        threadLocal.set(id);
    }

    //获取value
    public static Long getCurrentId (){
        return threadLocal.get();
    }
}
